Skip to content

Every file a generator changes is committed, generated tasks it settled are done, and a finished run always opens a PR - #358

Merged
nambok merged 1 commit into
mainfrom
fix/generated-output-done
Oct 29, 2026
Merged

nambok merged 1 commit into
mainfrom
fix/generated-output-done

Conversation

@nambok

@nambok nambok commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

A new-feature run finished 32 of 33 planned tasks and still ended without a pull request. The open task was the generated types file, which the studio's typegen writes from apps/studio to ../web/src/lib/sanity/sanity.types.ts.

The generator check ran typegen in the sandbox. The build finished with exit 0 and listed two changed files, apps/studio/schema.json and apps/web/src/lib/sanity/sanity.types.ts. The worker committed one of them and reported "regenerated 1 file(s)". Its log shows why: codegen: skipping oversized changed file. The generated types file was over the 5 MB per-file cap, so it was dropped without being named. The same happened on every run_codegen call the coder made.

The proof check then found the types file's task not done. After its fix round it ended the run with no pull request.

The path of the build output, the tar and the untar were not at fault. The changed files are listed from the repository root, so both paths were correct. The scope guard was not involved either.

Changes

Every changed file comes back, or is named (clients/sandbox.rs, generators.rs, implement.rs)

  • The new read_changed_tar reads the build's archive into Captured { files, dropped }.
  • The caps are raised to 50 MB per file and 200 files. That is well under GitHub's 100 MB blob limit and the worker's 2 GB of memory.
  • A file over a cap, or one that isn't text, is named in CodegenOutcome::dropped with the reason. It is never left out silently.
  • The generator gate reports a run with a dropped file as a tooling failure that names the file.
  • The coder's run_codegen result also says which files were not committed.

One spelling for paths (generators.rs normalize_path, plan_coverage.rs)

  • . and .. are resolved in every generator output, input glob, matched path and plan task path. apps/studio/../web/... becomes apps/web/....
  • Error messages now name the real file.

A generated task is done when its generator settled it (generators.rs GateOk, plan_coverage.rs settle_generated, proof.rs)

  • "Settled" means the generator ran to the end with its output committed, or its output was verified up to date.
  • The generator gate now returns the output globs it settled.
  • All three checks use that one answer:
    • The plan check's saved checklist marks those tasks done.
    • The proof judge is told which generated files are settled.
    • drop_settled_generated removes any planned-work finding about a settled file.
  • The settled list travels with a step that resumes at the checks (steps::Carry::generated).

A finished run always ends with a pull request (mod.rs, proof.rs, completeness.rs, pr.rs, resume.rs)

  • When the proof check still finds planned work after its fix round, the run no longer fails. It opens the pull request as a draft with a "Not finished" section at the top (proof::unfinished_section, a new Section::Unfinished).
  • That section is kept through description rewrites, and the planned work is not listed again under Open items.
  • mark_pr_ready keeps the pull request a draft while the section is there.
  • This applies to single- and multi-repository runs.
  • When the check lacked time for its round, the run still continues in a fresh step, as in Runs keep going while they make progress; a step's time never fails a run #357.

Verification

  • cargo fmt --all --check: clean.
  • cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test --workspace: common 1281, gateway 605, worker 977, plus 2; 0 failed.
  • New tests use the production layout: generator directory apps/studio, output ../web/src/lib/sanity/sanity.types.ts.
    • Both changed files come back from the archive, including a 7 MB types file that the old cap dropped. A file past a cap is named with its reason.
    • normalize_path, under and detection give apps/web/src/lib/sanity/sanity.types.ts; matching works whichever way the path is written; the not-run reason names the real path.
    • The settled set, and the plan check marking the generated task done (32 of 33 becomes 33 of 33).
    • The proof check drops planned work for a settled file, in either spelling, and keeps other planned work and other findings.
    • The "Not finished" section goes at the top, survives a rewrite and holds the draft; Open items doesn't repeat it.
    • Both pipelines open a draft instead of failing, and pass the settled outputs to the proof check.

…ed are done, and a finished run always opens a PR

A run's typegen (run from apps/studio, writing ../web/.../sanity.types.ts)
changed two files in the sandbox; the worker committed one and reported
"regenerated 1 file(s)". The other, the generated types file, was over the
5 MB per-file cap and was skipped with a log line that didn't name it. The
proof check then called that file's task not done and the run ended with
no pull request, 32 of 33 tasks done.

- The sandbox's changed files come back whole (cap 50 MB, 200 files); a
  file past a cap is named in the outcome, never dropped silently. The
  generator gate reports such a run as a tooling failure naming the file,
  and the coder's run_codegen says it.
- Generator paths are normalized (`..` resolved) everywhere they are
  compared: outputs, globs, plan task paths, the diff.
- A generated task is done when its generator ran to the end with its
  output committed, or verified up to date: the generator gate returns
  what it settled; the plan check's record, the proof judge's context and
  a filter on its planned-work findings all use it.
- Planned work the proof check still finds after its fix round no longer
  ends the run: the pull request opens as a draft with it in a "Not
  finished" section at the top, and stays a draft while it is there.
@nambok
nambok merged commit c21c1a2 into main Oct 29, 2026
8 checks passed
@nambok
nambok deleted the fix/generated-output-done branch October 29, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant